package rpc.balance;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BalanceConfig {

    @Bean
    @ConditionalOnProperty(name = {"balance"}, havingValue = "random")
    public BalancePlugin randomBalance(){
        return new RandomBalancePlugin();
    }

    @Bean
    @ConditionalOnProperty(name = {"balance"}, havingValue = "random")
    public BalancePlugin hashBalance(){
        return new HashBalancePlugin();
    }
}
